Annual forest cover variation in Madagascar at protected areas and national levels (2000-2021)
Author
Florent Bédécarrats
1 Introduction
When an assignment results more difficult than expected, it is useful to codify, document and share the solution found. This is the philosophy that guided the foundation by KfW and partners of the Mapme initiative, the main tool that we use here: it was developed to enable policy-makers, funders, researcher and consultant that design, monitor or evaluate projects and policies to share their solutions, best practices in using spatial data for this purpose. To reciprocate with this virtuous approach, we summarize here some challenges that we encountered and that were not trivial to solve, as well as the workarounds we found. We hope it will help 1) the evaluator to correctly interpret the indicators provided, 2) future analysts to improve these calculations or reproduce them in other countries, and 3) the developers of the mapme package including me) to further improve this wonderful tool.
Our assignment was to calculate the forest cover and annual forest cover loss of all terrestrial protected areas in Madagascar and also at national level. These calculations are intended to serve as an input for a KfW ex post evaluation of its support to conservation in this country.
# Load the R libraries needed for the analysis ---------------------------------------# Install latest version of mapme.biodiversityremotes::install_github("fBedecarrats/mapme.biodiversity",upgrade ="always")# Load required packageslibrary(mapme.biodiversity) # To get spatial data and compute indicatorslibrary(tidyverse) # To easily handle datalibrary(lubridate) # To handle spatial datalibrary(writexl) # To export the result in exel fileslibrary(sf) # To manage spatial datalibrary(geodata) # To get national boundarieslibrary(wdpar) # To get IUCN data on protected areas (WDPA)library(tmap) # To display mapslibrary(gt) # To make nice tableslibrary(cowplot) # for combined graphs# Get and display the WPDA data -----------------------------------------------------# Get national boundariescontour_mada <-gadm(country ="Madagascar", resolution =1, level =0,path ="data/GADM") %>%st_as_sf()# Get WDPA data WDPA_Mada <-wdpa_fetch("Madagascar", wait =TRUE, # using the wdpar packagedownload_dir ="data/WDPA") # store a copy locally# Display the interactive maptmap_mode("view") # for interactive modetm_shape(contour_mada) +tm_borders() +tm_shape(WDPA_Mada) +tm_polygons(col ="IUCN_CAT", alpha =0.6, title ="IUCN category",id ="NAME",popup.vars =c("Type"="DESIG","UICN category"="IUCN_CAT","Declared area (ha)"="REP_AREA","Year of the status"="STATUS_YR")) +tmap_options(check.and.fix =TRUE)